package com.hdl.design.pattern.prototype;

/**
 * 类名 Client
 * 描述 原型模式客户端
 *
 * @author hedonglin
 * @version 1.0
 * @date 2019/9/25 11:10
 */
public class Client {
    public static void main(String[] args) throws CloneNotSupportedException {
        System.out.println("============本身对象对象字段和克隆对象对象字段比较===========");
        ConcretePrototype first = new ConcretePrototype("1", new User("张三",5));
        ConcretePrototype clone = first.clone();
        System.out.println(clone == first);
        System.out.println(clone.getUser() == first.getUser()); // false
        System.out.println("============本身对象对象字段和克隆对象对象字段比较===========");
    }
}
